package demo2;
//cycle", "rect", "cycle", "rect", "flower
class Shape{
    public void fun(){
        System.out.println("未知！");
    }
}
class Cycle extends Shape{
    @Override
    public void fun() {
        System.out.println("○");
    }
}
class Rect extends Shape{
    @Override
    public void fun() {
        System.out.println("矩形");
    }
}
class Flower extends Shape{
    @Override
    public void fun() {
        System.out.println("❀");
    }
}
public class Test {
    public static void main(String[] args) {
        Shape[] arr=new Shape[]{new Cycle(),new Rect(),new Cycle(),new Rect(),new Flower()};
        for (Shape s :arr) {
            s.fun();
        }
    }
}
